var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
o.KeyMode = void 0;
var a = t("QKeyBoxData");
(function (t) {
    t[(t.randMode = 0)] = "randMode";
    t[(t.key16a = 1)] = "key16a";
    t[(t.key20a = 2)] = "key20a";
    t[(t.keychara = 3)] = "keychara";
})(o.KeyMode || (o.KeyMode = {}));
var i = (function () {
    function t() {
        this._keyData = null;
    }
    t.prototype.setLable = function (t) {
        this.lable = t;
    };
    t.prototype.setView = function (t) {
        cc.isValid(this.lable) && cc.isValid(this.lable.node.parent) && (this.lable.node.parent.active = t);
    };
    t.prototype.updataView = function (t) {
        this._keyData = t;
        this.view();
    };
    t.prototype.doKey = function () {
        cc.isValid(this._keyData) && this._keyData.keyAction(this._keyData);
    };
    t.prototype.view = function () {
        if (cc.isValid(this.lable && this._keyData)) {
            this.lable.string = this._keyData.viewStr1 || "未声明";
            this.setSize(this.lable.node.parent);
            this.lable.node.parent.setPosition(this._keyData.nodePos);
        }
    };
    t.prototype.setSize = function (t) {
        t.width = a.default.keyWidth;
        t.height = a.default.keyHeigth;
    };
    return t;
})();
o.default = i;
